{% extends "layouts/base.phtml" %}

{% block content %}

<!-- page heading start-->
<div class="page-heading">
    <form class="form-inline" role="form">
        <div class="form-group">
            <label>会员身份：</label>
            <select class="form-control">
                <option value="0">全部</option>
                <option value="1">刷手</option>
                <option value="2">商家</option>
            </select>
        </div>
        &nbsp;&nbsp;
        <div class="form-group">
            <label>会员类型：</label>
            <select class="form-control">
                <option value="0">全部</option>
                <option value="1">刷手</option>
                <option value="2">商家</option>
            </select>
        </div>
    </form>
</div>
<!-- page heading end-->

<!--body wrapper start-->
<div class="wrapper">
    <section class="panel">
        <header class="panel-heading no-border">
            标签列表
                            <span class="tools pull-right">
                                <a href="javascript:;" class="fa fa-chevron-down"></a>
                                <a href="javascript:;" class="fa fa-times"></a>
                             </span>
        </header>
        <div class="panel-body">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th>
                        <div class="icheck">
                            <div class="square-red single-row">
                                <div class="checkbox">
                                    <input type="checkbox" id="allID">
                                    <label for="allID">全选</label>
                                </div>
                            </div>
                        </div>
                    </th>
                    <th>ID</th>
                    <th>标签类型</th>
                    <th>标签名</th>
                    <th>操作</th>
                </tr>
                </thead>

                <tbody>
                {% for item in page.items %}
                <tr>
                    <td>
                        <div class="icheck">
                            <div class="square-red single-row">
                                <div class="checkbox">
                                    <input type="checkbox" name="delID" value="{{ item.tag_id }}">
                                    <label></label>
                                </div>
                            </div>
                        </div>
                    </td>
                    <td>{{ item.tag_id }}</td>
                    <td>{{ item.tag_name }}</td>
                    <td>{% if item.tag_type==1 %}淘宝{% elseif item.tag_type==2 %}京东{% endif %}</td>
                    <td>
                        <button type="button" class="btn btn-info btn-sm" onclick="look({{ item.tag_id }})">查看</button>
                        <button type="button" class="btn btn-success btn-sm ml10" onclick="edit({{ item.tag_id }})">编辑</button>
                        <button type="button" class="btn btn-danger btn-sm ml10" onclick="del({{ item.tag_id }})">删除</button>
                    </td>
                </tr>
                {% endfor %}
                </tbody>
            </table>
            <div class="col-lg-6 col-sm-6">
                <button type="button" class="btn btn-danger btn-sm" onclick="dels()">删除所选</button>
            </div>
            <div class="col-lg-6 col-sm-6">
                <div class="dataTables_paginate paging_bootstrap pagination">
                    <ul>
                        <li class="prev"><a href="/tag?page={{ page.before }}"><<</a></li>
                        {% for num in startNum..lastNum %}
                        <li {% if currentPage==num %} class="active" {% endif %}><a href="/tag?page={{ num }}">{{ num }}</a></li>
                        {% endfor %}
                        <li class="next"><a href="/tag?page={{ page.next }}">>></a></li>
                    </ul>
                </div>
            </div>
        </div>
    </section>
</div>

<!-- Modal -->
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
                <h4 class="modal-title">信息</h4>
            </div>
            <div class="modal-body">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success" data-dismiss="modal">确定</button>
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal1" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
                <h4 class="modal-title">编辑信息</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" role="form" id="editForm" action="/tag/doedit" method="post">
                    <table class="table">

                    </table>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success" onclick="doedit()">编辑</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal">退出</button>
            </div>
        </div>
    </div>
</div>

{% endblock %}

{% block jsInclude %}
{{ javascript_include("static/js/tag-index.js") }}
{% endblock %}